package net.cooltain.warhammer.running.window.panel;

import java.awt.Graphics;
import java.io.IOException;

import net.cooltain.warhammer.running.entity.MotionCard;
import net.cooltain.warhammer.running.entity.MotionPlayerZone;
import net.cooltain.warhammer.running.window.MainFrame;

public class PlayZoneCardLabel extends CardLabel {
	
	private static final long serialVersionUID = -1267720137648810985L;
	
	public PlayZoneCardLabel(MotionPlayerZone actPlayer,MotionCard motionCard) {
		super(actPlayer, motionCard);
		this.setDoubleBuffered(true);
		this.motionCard = motionCard;
		this.actPlayer = actPlayer;
	}

	
	public void paintComponent(Graphics g){ 
		super.paintComponent(g); 
		try {
			if(motionCard.isFlip()){
				g.drawImage( backImage ,0,0, MainFrame.CARD_W,MainFrame.CARD_H,   null);				
			}else if(motionCard.checkVisiblePlayer(actPlayer)){
				g.drawImage(motionCard.cardEntity.getIconImage().getImage(),0,0, MainFrame.CARD_W,MainFrame.CARD_H,   null);				
			}else{
				g.drawImage( backImage,0,0, MainFrame.CARD_W,MainFrame.CARD_H,   null);				
			}
			System.out.println("111111111111111111111111111111111111111111111");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
